package com.zl.rbac.VO;

import lombok.Data;
import lombok.Getter;

/**
 * 响应给前端的统一的响应对象
 * @ClassName: ResultVO
 * @author: suke
 * @since: 2021/1/4 17:06
 */
@Getter
public class ResultVO<T> {
    private int code;
    private String msg;
    private T data;

    public ResultVO(T data) {
        this(ResultCode.SUCCESS, data);
    }

    public ResultVO(ResultCode resultCode, T data) {
        this.code = resultCode.getCode();
        this.msg = resultCode.getMsg();
        this.data = data;
    }

    public static ResultVO SUCCESS(){
        return new ResultVO(null);
    };
}
